home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / library / help / tcl / files / server_open < prev    next >
Encoding:
Text File  |  1993-10-26  |  1.4 KB  |  28 lines  |  [TEXT/$Tcl]

  1.  
  2.  
  3.           server_open ?option? host service
  4.                Open a TCP/IP connection to a server  of  host  on  the
  5.                port specified by service.  The server is then accessed
  6.                using the standard Tcl file I/O commands.  Host may  be
  7.                a  host  name  or  an  IP  address.  Port may be a port
  8.                number of a service name.  Option is  one  of  -buf  or
  9.                -nobuf.   If  no  options  is  specified,  -buf  is the
  10.                default.
  11.  
  12.                If -buf is specified, then the file  is  buffered.   In
  13.                this  case,  a  pair  of Tcl file ids are returned in a
  14.                list.  The first id is open for read access, the second
  15.                for write.  When writing to the file, the flush command
  16.                must be used to force data in the buffer to be sent  to
  17.                the  server.   The close command must be called against
  18.                both file ids when through with the  socket.   Buffered
  19.                access  will result in significantly better performance
  20.                when reading data and will also  improve  a  series  of
  21.                writes being done with out intermixed reads.  The fcntl
  22.                command may be used to make one of these  files  unbuf-
  23.                fered.
  24.  
  25.                if -nobuf is specified, then the file is unbuffered and
  26.                a single file id, open for both reading and writing, is
  27.                returned.
  28.